<?php

declare(strict_types=1);

use Phinx\Migration\AbstractMigration;

final class TableProductsCategoryFieldsRelationshipCreate extends AbstractMigration
{
    /**
     * Change Method.
     *
     * Write your reversible migrations using this method.
     *
     * More information on writing migrations is available here:
     * https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
     *
     * Remember to call "create()" or "update()" and NOT "save()" when working
     * with the Table class.
     */
    public function change(): void
    {
        $table = $this->table('ctmon_products_category_fields_relationship', ['engine' => 'InnoDB', 'signed' => false, 'collation' => 'utf8mb4_general_ci', 'comment' => '产品分类与字段的关联表||']);
        $table->addColumn('cat_id', 'integer', ['comment' => '产品分类id'])
            ->addColumn('field_id', 'integer', ['comment' => '字段id'])
            ->addColumn('ver', 'biginteger', array('limit' => 20, 'signed' => false, 'null' => false, 'default' => 0, 'comment' => '版本检查'))
            ->addColumn('create_time', 'integer', array('limit' => 10, 'null' => false, 'signed' => false, 'default' => 0, 'comment' => '创建时间'))
            ->addColumn('update_time', 'integer', array('limit' => 10, 'null' => false, 'signed' => false, 'default' => 0, 'comment' => '修改时间'))
            ->addColumn('delete_time', 'integer', array('limit' => 10, 'null' => false, 'signed' => false, 'default' => 0, 'comment' => '删除时间'))
            ->create();
    }
}
